package jastgen.generator;

import static jastgen.generator.Helper.*;

import java.io.PrintWriter;

import jastgen.CompileException;
import jastgen.nodes.ClassDef;
import jastgen.nodes.Module;

class VoidVisitorStubBodyGenerator implements BodyGenerator {

	private final Module node;

	VoidVisitorStubBodyGenerator(
			final Module node
		) throws CompileException {

		this.node = node;
	}

	public void generate(
			final PrintWriter out)
	{
		generateVisitorBody(out, node);
	}

	private void generateVisitorBody(
			final PrintWriter out,
			final Module node)
	{
		out.println("public abstract class VoidVisitorStub extends VoidVisitorImpl {");

		for(final ClassDef c : node.getClassDefs()) {
			printMethod(out, c, "void");
		}

		out.println("}");
	}
}
